<!--
 * @Author: coman
 * @LastEditors: coman
 * @Date: 2020-06-09 17:06:36
 * @motto: No pain,No gain
 * @LastEditTime: 2020-06-09 17:21:07
--> 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    输入你的身高:<input type="text" id="height">
    输入您的体重:<input type="text" id="weight">
    <input type="button" onclick="getweight()" value="点击获取报告">

    <script>
        function getweight(){
            var height = document.getElementById("height").value;
            var weight = document.getElementById("weight").value;
            if((height-108) *2 + 10 >= weight && weight>=(height-108)*2-10){
                alert("您的体重合适,请继续保持")
            }else{
                alert("看来你要控制体重了");
            }
        }
    </script>
</body>
</html>